<?php 
header("Content-type: text/html; charset=utf-8");
$conn = @mysql_connect( 'localhost','root','')
or die('数据库无法连接！');
mysql_set_charset('utf8');
@mysql_select_db('neu-video',$conn)
or die('数据库无法连接');
$SQLstring='select t1.*,t2.typename from videos t1 left join videotype t2 on t1.tid=t2.tid';
$result = mysql_query($SQLstring,$conn);
$users=fetch_array($result);
echo'<table border="1">';
echo '<caption>视频详情</caption>';
echo'<tr>
<th>序号</th>
<th>视频名称</th>
<th>视频类型</th>
<th>视频类型名称</th>
<th>视频海报</th>
<th>内容简介</th>
<th>添加日期</th>
<th>上传用户</th>
<th>点击率</th>
<th>下载量</th>
<th>下载地址</th>
</tr>';
foreach ($users as $one) {
echo'<tr>';
echo '<td>'.$one['vid'].'<br>'.'</td>';
echo '<td>'.$one['videoname'].'<br>'.'</td>';
echo '<td>'.$one['tid'].'<br>'.'</td>';
echo '<td>'.$one['typename'].'<br>'.'</td>';
echo '<td>'.$one['pic'].'<br>'.'</td>';
echo '<td>'.$one['intro'].'<br>'.'</td>';
echo '<td>'.$one['uploaddate'].'<br>'.'</td>';
echo '<td>'.$one['uploadadmin'].'<br>'.'</td>';
echo '<td>'.$one['hittimes'].'<br>'.'</td>';
echo '<td>'.$one['downtimes'].'<br>'.'</td>';
echo '<td>'.$one['address'].'<br>'.'</td>';
echo'</tr>';
}

function fetch_array($Results){
$arrs =array();
while ($Results && ($row = mysql_fetch_assoc($Results))!== FALSE){
$arrs[]=$row;
}
return $arrs;
}
 ?>